Using Background Images in an Absolute Layout Container

Description

Using the absolute layout container in conjunction with images presents some powerful options for structuring the user interface of an application.

This guide describes how to add images to the absolute layout container; in addition to data controls. Adding background images to an absolute layout container is also covered in this video. You can add background images that appear like a form, such as a 1040 tax return form or a pdf.

Create the Absolute Container

  1. In the UX Builder on the UX Controls page open the 'Data Controls' menu. Click on the [DropdownBox] option to add a dropdown box control to the component. Give the textbox the name and label of 'species'.

    images/alc3.png
  2. Highlight the dropdown box in the controls tree. Scroll down the properties list on the right to the 'DropDownBox Properties' section. Click the [...] button next to the 'Choices' property.

    images/alc4.png
  3. Select the 'Static' option from the 'Choices are:' list and add the following satic choices to the dropdown.

    Baetis tricaudatus
    Callibaetis fluctuans
    Epeorus pluralis
    Epeorus vitreus
    Ephemerella invaria
    Ephemerella needhami
    Ephemerella subvaria
    Hydropsyche alternans
    Isonychia bicolor
    Leptophlebia cupida
    Maccaffertium ithaca
    Paraleptophlebia adoptiva
    Paraleptophlebia mollis
    Pteronarcys dorsata
    Siplonurus occidentalis
    Taeniopteryx nivalis
    images/alc5.png
  4. In the 'Data Controls' menu click on the [TextBox] option to add a textbox control. Name and label the textbox 'Location'.

    images/alc6.png
  5. Add two more textbox controls to the component. Name and label these controls 'Time' and 'Temperature'.

    images/alc7.png
  6. Highlight all of the textbox controls. Open the 'Containers' menu and click on the [Container] option.

    images/alc8.png
  7. From the Container Type list select the 'AbsoluteLayout' option and click 'OK'

    images/alc9.png

Define a Background Image for the AbsoluteLayout Container.

  1. Have an image to use as a background, like the one below:

    images/alc2.png
    The areas that appear as whitespace on this image are where new controls will be placed. Make sure to make these spaces large enough for the control. If a dropdown box control is made too small, for example, then it might not display properly when the component is run.
  2. Highlight the opening 'AbsoluteLayout' container tag, [AbsoluteLayout: ABSOLUTELAYOUT_1].

    images/alc10.png
  3. In the properties list on the right check the 'Has background image' checkbox in the 'Container Begin Properties' section.

    images/alc11.png
  4. Click the [...] button next to the 'Background image' property.

    images/alc12.png
  5. Check the 'Image in Web Project or Style' radio button and click the 'Select' button.

    images/alc13.png
  6. Choose the 'Select from Web Project Folder' option.

    images/alc14.png
  7. Click the 'Add Image to Project' button.

    images/alc15.png
  8. Click the up arrow next to the 'Source File' textbox.

    images/alc16.png
  9. Navigate to the image file that you defined. Click 'Open', then 'OK', 'OK', and 'OK' again.

    images/alc17.png

Place The Absolute Layout Controls over the Image.

  1. Highlight the opening tag for the AbsoluteLayout container, "[AbsoluteLayout: ABSOLUTELAYOUT_1]".

    images/alc18.png
  2. In the properties list on the right, in the 'Container Begin Properties' section, click the [...] button next to the 'Absolute positions for controls' property. The 'Set Absolute Position and Size' editor will open.

    images/alc19.png
  3. In the middle panel of the 'Set Absolute Position and Size' editor find the dotted rectangle that represents the size of the layout. Drag the grey triangle in the lower right-hand corner of the dotted rectangle until the layout size is the same as the image size.

    images/alc20.png
  4. In the fields list in the top left corner highlight the 'species' field.

    images/alc21.png
  5. Place the mouse cursor inside the layout where the species box is defined. Click and hold down the left-hand mouse button and drag out the 'species' dropdown-box control.

    images/alc22.png
  6. Release the mouse button to add the control. Adjust the position of the 'species' dropdown control's border as needed.

    images/alc23.png
  7. Highlight the Location textbox control and drag out the control inside the absolute layout.

    images/alc24.png
  8. Add the 'Time' and 'Temperature' textbox controls to the layout. Click OK to close the editor.

    images/alc25.png
  9. Run the component in Live Preview. You should see the controls displayed inside the absolute layout component.

    images/alc27.png
  10. The dropdown:

    images/alc28.png